package container

import (
	"container-management/api/container/v1"
	"container-management/internal/service"
	"container-management/utility/response"
	"context"
	"github.com/gogf/gf/v2/frame/g"
)

func (c *ControllerV1) CreateContainer(ctx context.Context, req *v1.CreateContainerReq) (res *v1.CreateContainerRes, err error) {
	err = service.Container().CreateContainer(ctx, req)
	if err != nil {
		response.JsonExit(g.RequestFromCtx(ctx), response.CodeInternal, nil)
		return
	}
	response.JsonExit(g.RequestFromCtx(ctx), response.CodeSuccess, nil)
	return
}
